package cn.btks.resultintegration.catalog.service;

import cn.btks.commonserver.result.ResultState;
import cn.btks.resultintegration.catalog.pojo.PolicyFile;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author lijun
 * @CompileUnit 测绘地理信息分院研发中心
 * @Date 2023/10/10 10:36
 */
public interface PolicyFileService {

    /**
     * 根据文件ID查询
     * @param id
     * @return
     */
    PolicyFile findById(Long id);

    /**
     * 根据文件名称查询
     * @param fileName
     * @return
     */
    List<PolicyFile> findByName(String fileName);

    /**
     * 根据目录ID查询
     * @param catalogId
     * @return
     */
    List<PolicyFile> findByCatalogId(Long catalogId);

    /**
     * 上传文件
     * @param policyFile
     * @param list
     * @param request
     * @return
     */
    ResultState save(PolicyFile policyFile, List<MultipartFile> list, HttpServletRequest request) throws Exception;

    /**
     * 删除文件
     * @param id
     * @return
     */
    ResultState delete(Long id);
}
